Skip to main content

5.1.2 Create a withdrawal of digital currency to any wallet (merchant-defined exchange rate)

#Brief description: Withdraw digital currency to the wallet's withdrawal business interface, allowing users to transfer usdt to the specified wallet address (Merchant-defined exchange rate requires logging into the merchant backend to set it)

Request parameters
Parameter nameTypeRequiredParameter meaningParameter description
keystringYesMerchant keyapiKey
localOrderIdstringYesMerchant platform local order numberMerchant platform generates unique order number locally
localUserIdstringNoMerchant platform local user IDMerchant platform local user ID
notifyUrlstringNoCallback addressAfter the order is successfully placed, the address of the merchant will be notified by the API callback request (callback details are at the bottom)
successRedirectUrlstringNoAddressAutomatically jump to the address after success
currencystringYesCurrencyOrder Currency
networkstringYesMainnetMainnet (currently only supports TRON, BSC, POLYGON, ETHEREUM)
addressstringYesWithdrawal AddressWithdrawal Address
quoteCurrencystringYesOrder quotation currencyOrder quotation currency (you need to log in to the merchant backend to set the quotation currency exchange rate)
quoteAmountstringYesQuotation AmountQuotation Amount
isBlockchainbooleanNoWhether to return blockchain information (default false)When true, the callback request will carry the transaction information on the order chain
expireSecondLongNoExpiration timestamp (seconds)
signstringYesSignatureSee Signature Algorithm for details
Request json sample
{
"key": "9yUreYgTRtit39Dy",
"localOrderId":"conantest0128",
"localUserId":"996",
"currency":"USDT",
"network":"TRON",
"address":"TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"quoteCurrency":"CNY",
"quoteAmount":"20",
"sign":"f0ef4f925b899734727b77975ff9c0a3"
}

Response json example

{
"code": 0,
"success": true,
"message": null,
"data": {
"orderId": 473228783386885,
"localUserId": "996",
"localOrderId": "conantest0128",
"orderType": "WITHDRAW",
"orderBizType": "WITHDRAW_ANY_DIGITAL_WALLET",
"targetType": "EXTERNAL",
"network": "TRON",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "20",
"userAmount": "20",
"userReceivableAmount": "20",
"rate": "1",
"rateExpression": "1USDT≈1CNY"
}
}
Response data parameter description
Parameter nameTypeParameter meaningRemarks
orderIdstringOrder ID
localUserIdstringMerchant local user ID
localOrderIdstringMerchant local order number
orderTypeenumOrder TypePAYMENT:支付订单 | WITHDRAW:提款订单
orderBizTypeenumOrder business typeorderBizType type description is as follows
targetTypeenumTarget typetargetType type description is as follows
networkstringMainnet type
addressstringAddressOn-chain payment address
currencystringOrder currency
userCurrencystringArrival currency
amountstringOrder amount
userAmountstringAmount actually received by the user
userReceivableAmountstringUser receivable amount
ratestringExchange rate
rateExpressionstringExchange rate expression

orderBizType type description:

  1. PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
  2. PAYMENT_TRANSFER digital currency binding address direct deposit
  3. PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
  4. WITHDRAW_WALLET withdraw money to MINPAY wallet
  5. WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
  6. PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
  7. BATCH_PAY batch payment

targetType type description:

  1. INTERNAL internal address
  2. EXTERNAL external address
  3. USER user abstract address

Callback details

The callback method is: POST application/json
Example of jsonization of callback parameters
{
"amount":"10",
"bizType":"WITHDRAW_ANY_DIGITAL_WALLET",
"currency":"CNY",
"extra":{
"quoteAmount":"10",
"quoteCurrency":"CNY",
"quotePrice":"1"
},
"localOrderId":"conantest0132",
"merchantActualAmount":"94.63",
"merchantCurrency":"CNY",
"merchantId":302992856974,
"merchantPaidAmount":"66.84",
"merchantUserId":"996",
"notifyTime":1772266852130,
"orderCreateTime":1772266745032,
"orderId":"473284157243653",
"status":"SUCCESS",
"type":"WITHDRAW",
"userAmount":"8.5",
"userCurrency":"USDT",
"userMinerFee":"1.5",
"userReceivableAmount":"10",
"sign":"78ef83b365e77c66b0cc3a283f8ebae4",
"key":"9yUreYgTRtit39Dy"
}
Parameter nameTypeParticipating signatureParameter meaningParameter description
amountdecimalYesOrder Amount
bizTypeenumYesOrder typebizType type description is as follows
currencyStringYesCurrency
keyStringYesMerchant key
localOrderIdStringYesLocal order number
merchantActualAmountdecimalYesMerchant’s actual payment amount
merchantCurrencyStringYesMerchant payment currencyDefault currency
merchantIdStringYesMerchant ID
merchantPaidAmountdecimalYesMerchant payment amount
merchantUserIdStringYesUser id
notifyTimelongYesCallback time
orderCreateTimelongYesOrder Creation Time
orderIdStringYesOrder number
statusStringYesPayment Status
typeStringYesOrder TypePAYMENT:支付 WITHDRAW:提款
userAmountdecimalYesUser payment amount
userCurrencyStringYesUser payment currency
signStringNomd5 signatureSee signature algorithm for details
extraobjectYesContains the following parameters
└quoteAmountnumberYesOrder quote amount
└quoteCurrencynumberYesOrder quote currency
└quotePricestringYesOrder quotation price
userMinerFeeStringYesMining feeWithdrawal mining fee
userReceivableAmountStringYesUser receivable amountUser receivable amount
blockchainobjectYesChain transaction informationWhen the order request parameter isBlockchain is true, the callback request will carry this object information. (When only on-chain transactions are involved, the isBlockchain parameter will take effect)
└networkStringYesMainnet
└receiverAddressStringYesReceiver Address
└senderAddressdecimalYesSending Address
└txIdStringYesTransaction ID

bizType type description:

  1. PAYMENT_WALLET_SCAN MINPAY wallet scan code payment
  2. PAYMENT_TRANSFER digital currency binding address direct deposit
  3. PAYMENT_ANY_DIGITAL_SCAN Scan the QR code to pay any amount of digital currency
  4. WITHDRAW_WALLET withdraw money to MINPAY wallet
  5. WITHDRAW_ANY_DIGITAL_WALLET Withdraw digital currency to any wallet
  6. PAYMENT_FIXED_DIGITAL_SCAN digital currency limited amount scan code payment
  7. BATCH_PAY batch payment

When you receive the callback notification, please directly return the string success after the processing is completed, indicating that the message has been successfully received and processed. After the system receives the success response, it will no longer send the callback repeatedly. If the expected response is not received (success is not returned or an exception is returned), the system will resend the callback notification according to the stepped retry mechanism, retrying up to 14 times. The current retry intervals are: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s